<template>
  <view class="content">
  </view>
</template>

<script>
export default {
  data() {
    return {
      show: false,
    };
  },
  created() {
    // console.log(this.$route.query);
  },
  onLoad() {
    // alert("window.location.href：" + window.location.href);
    if (window.location.href.includes("userInfo")) {
      var userInfo = this.getQueryUserInfo();
      console.log("userInfo：", userInfo);
      // var openId = userInfo.openid;
      // userInfo = userInfo={"openid":"oTjKM1RdGBF_pFzBCUj1eXxDlJkk","nickname":"???","sex":0,"language":"","city":"","province":"","country":"","headimgurl":"https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKJTU9jr88gaic5M8dF7qiaxIVLrY9zrNhB5GUIzyoCZS5icvP1Tu7kJbEbU3gko1rJOIKKicUPB5rdtQ/132","privilege":[]}
      uni.setStorageSync("userInfo", userInfo);
    } else {
      // uni.removeStorageSync("userInfo");
      // window.location.href = "https://5552465i6s.imdo.co/wxmarket/login";
    }
  },
  onShow() {},
  mounted() {},
  computed: {},
  methods: {
    navClick(url) {
      this.show = false;
      this.$u.route({
        url: url,
      });
    },
    getQueryUserInfo() {
      var name = "userInfo";
      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
      var r = window.location.search.substr(1).match(reg);
      if (r != null) {
        let userInfo = JSON.parse(unescape(r[2]));
        return userInfo;
      } else {
        return null;
      }
    },
  },
};
</script>

<style>
.content {
  width: 100%;
  height: 100%;
  background-image: url("../../assets/imgs/bg.png");
  background-size: 100% 100%;
  /* background-size: contain;
  background-repeat: no-repeat; */
}
</style>
